﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMNhomVSGPBDAO
    {
        public bool m_Insert(DMNhomVSGPBDTO _info)
        {
            int nhom = 0;
            if (_info.BbNgungSuDung == true)
                nhom = 1;
            string _sql = string.Format("usp_ThuNgan_DMNhomVSGPB_Insert  N'{0}',N'{1}',{2}", _info.STenNhomVSGPB, _info.STenVni, nhom);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMNhomVSGPBDTO _info)
        {
            int nhom = 0;
            if (_info.BbNgungSuDung == true)
                nhom = 1;
            string _sql = string.Format("usp_ThuNgan_DMNhomVSGPB_Update {0},N'{1}',N'{2}',{3}", _info.IIDNhomVSGPB, _info.STenNhomVSGPB, _info.STenVni, nhom);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMNhomVSGPBDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMNhomVSGPB_Delete {0}", _info.IIDNhomVSGPB);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMNhomVSGPB()
        {
            string _sql = string.Format("usp_ThuNgan_DMNhomVSGPB_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        //Reflect to DMDichVu------------------
        public DataTable m_SelectDMNhomVSGPB()
        {
            string _sql = string.Format("usp_ThuNgan_DMNhomVSGPB_SelectTenNhomVSGPB");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
